Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS2: boostrap repo and convert gazebo_msgs #769

Merged
merged 3 commits into from
Jul 17, 2018

Conversation

kev-the-dev
Copy link
Collaborator

@kev-the-dev kev-the-dev commented Jul 13, 2018

  • Convert the messages in gazebo_msgs to ROS2 compliant message files (replaces gazebo_msgs: converted messages to ros2 format. #735)
  • Move all remaining code to .ros1_unported, which has IGNORE files to be ignored by ament/colcon. This will ensure the package builds and individual files will be moved back to into the root directory as they are ported over

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting the ball rolling! I left some preliminary comments, mostly about documentation and styling.

</description>

<maintainer email="jrivero@osrfoundation.org">Jose Luis Rivero</maintainer>
<author>John Hsu</author>
<maintainer email="ecorbellini@ekumenlabs.com">Ernesto Corbellini</maintainer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the author and maintainer changes on purpose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, will fix

float64[] hiStop # joint limit
float64[] loStop # joint limit
float64[] hi_stop # joint limit
float64[] lo_stop # joint limit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: align the comments on the right

# if start_time is not specified, or
# start_time < current time, start as soon as possible
duration duration # optional duration of wrench application time (seconds)
builtin_interfaces/Duration duration # optional duration of wrench application time (seconds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment alignment

@@ -0,0 +1,33 @@
#include <gazebo_plugins/node_example.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing copyright header here and on several other files

namespace gazebo_ros
{

/// Executor run in a seperate thread to handle events from all #Node instances
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use doxygen syntax on the whole documentation? i.e. /// \brief

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\brief is implied with the first line of a doxygen block so my personal style preference is to omit it (it will still generate correctly)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I didn't know. I'm good leaving it out then.

NotInitializedException();
};

typedef std::shared_ptr<Node> SharedPtr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making this type more explicit? Such as NodeSharedPtr? That should make the API clearer and we don't end up reserving a very general "keyword".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the convention used in other parts of the ROS2 codebase so far. The typedef is within the class, so it is accessed as gazebo_ros::Node::SharedPtr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh got it, good call!

*/
static SharedPtr Create(const std::string& node_name);

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize the ROS 1 code mixes /// with /**, the ROS 2 developer guide accepts either and they're both supported by Doxygen.

I think there's value in being consistent within a single repository though, so I think we should define now which one to use. I don't have a preference, so I'll leave up to you or anyone with strong opinions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it should be consistent. Looks like some other ros2 code always starts with /// and adds /** */ if more lines are required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, that looks weird to me on a first look, I wonder how that gets rendered and what's the rationale behind it.


/// Initialize ROS with the command line arguments.
/// Must be called ONCE before ande #Node instances are created
static void InitROS(int argc, char** argv);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document input params

<name>gazebo_ros</name>
<version>2.8.4</version>
<description>
Provides ROS plugins that offer message and service publishers for interfacing with <a href="http://gazebosim.org">Gazebo</a> through ROS.
Formally simulator_gazebo/gazebo
Utilities to interface with Gazebo <a href="http://gazebosim.org">Gazebo</a> through ROS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gazebo is written twice

<!--
Need to use gazebo_dev since run script needs pkg-config
See: https://github.com/ros-simulation/gazebo_ros_pkgs/issues/323 for more info
-->
<exec_depend>gazebo_dev</exec_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gazebo_dev is already listed above

"srv/SetJointTrajectory.srv"
"srv/GetLightProperties.srv"
"srv/SetLightProperties.srv"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about alphabetizing this list? The messages are already ok

@chapulina
Copy link
Contributor

How about splitting this PR so it's easier to review? It could start with just porting the messages and moving all unported code to the separate folder.

@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<package format="2">
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we keep format 2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but format 3 offers some advantages and will likely be supported for longer. It seems to be the default for new ROS2 packages

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think it's best not to upgrade unless there's an explicit reason to, so we keep compatibility with older tools.

It doesn't look to me that we're using anything specific to version 3 here, so I don't see a need for the move. But it doesn't look like it's breaking anything either, so we can leave it as 3 for as long as we don't see a problem with it.

@kev-the-dev
Copy link
Collaborator Author

The PR splitting sounds good, time to put on my git hat

@kev-the-dev kev-the-dev changed the title Initial work for ROS2 support ROS2: boostrap repo and convert gazebo_msgs Jul 17, 2018
@kev-the-dev
Copy link
Collaborator Author

Split out everything besides the file moves and message conversions. The rest is on other branches I can PR when this one is in


<build_depend>rosidl_default_generators</build_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be buildtool_depend?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched, that seems like the right way to do it

@chapulina
Copy link
Contributor

Thanks, @ironmig ! This PR looks good to me, I just have one small comment left about buildtool_depend

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@kev-the-dev kev-the-dev merged commit 03ec199 into ros-simulation:ros2 Jul 17, 2018
@dhood dhood added the ros2 label Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants